package com.zr.lads.pojo;
// Generated 2016-10-26 11:45:42 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Line generated by hbm2java
 */
@Entity
@Table(name = "line", catalog = "lads")
public class Line implements java.io.Serializable {

	private Integer lineId;
	private String lineName;
	private String beginPoint;
	private String endPoint;
	private Set<Schedule> schedules = new HashSet<Schedule>(0);

	public Line() {
	}

	public Line(String lineName, String beginPoint, String endPoint, Set schedules) {
		this.lineName = lineName;
		this.beginPoint = beginPoint;
		this.endPoint = endPoint;
		this.schedules = schedules;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "line_id", unique = true, nullable = false)
	public Integer getLineId() {
		return this.lineId;
	}

	public void setLineId(Integer lineId) {
		this.lineId = lineId;
	}

	@Column(name = "line_name", length = 32)
	public String getLineName() {
		return this.lineName;
	}

	public void setLineName(String lineName) {
		this.lineName = lineName;
	}

	@Column(name = "beginPoint", length = 32)
	public String getBeginPoint() {
		return this.beginPoint;
	}

	public void setBeginPoint(String beginPoint) {
		this.beginPoint = beginPoint;
	}

	@Column(name = "endPoint", length = 32)
	public String getEndPoint() {
		return this.endPoint;
	}

	public void setEndPoint(String endPoint) {
		this.endPoint = endPoint;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "line", cascade = CascadeType.REMOVE)
	public Set<Schedule> getSchedules() {
		return schedules;
	}

	public void setSchedules(Set<Schedule> schedules) {
		this.schedules = schedules;
	}

}
